package fr.fort.lycee.spring.businesssImpl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import fr.fort.lycee.spring.businesss.IBusinessInscription;
import fr.fort.lycee.spring.daoImpl.DaoInscriptionImpl;
import fr.fort.lycee.spring.entities.Inscription;

@Service("BusinessInscription")
@Transactional
public class BusinessInscriptionImpl implements IBusinessInscription {
	@Autowired
	private DaoInscriptionImpl daoInscription;

	public Integer save(Inscription inscription) {
		Integer id = daoInscription.save(inscription);
		return id;
	}

	public void update(Inscription inscription) {
		daoInscription.update(inscription);
	}

	public void delete(Inscription inscription) {
		daoInscription.delete(inscription);
	}

	public Inscription findById(int id) {
		Inscription retour = daoInscription.findById(id);
		return retour;
	}

	@Override
	public List<Inscription> findAll() {
		List<Inscription> retour = new ArrayList<>();
		retour = daoInscription.findAll();
		return retour;
	}
}
